/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SLE_ERROR_CODE_H
#define SLE_ERROR_CODE_H
#include <stdint.h>

typedef enum {
    /** No errors. */
    SLE_NO_ERROR = 0,
    /** Opration failed. */
    SLE_ERR_FAILED = 1,
    /** Invalid input parameters */
    SLE_ERR_INVALID_PARAM = 2,
    /** Service or driver not init yet */
    SLE_ERR_NOT_READY = 3,
    /** Wrong status to do the opration */
    SLE_ERR_STATUS_WRONG = 4,
    /** Out of memory */
    SLE_ERR_NO_MEM = 5,
    /** OS system methods wrong */
    SLE_ERR_SYSTEM_WRONG = 6,
    /** IPC transport failed */
    SLE_ERR_IPC_TRANS_FAILED = 7,
    /** IPC remote died */
    SLE_ERR_IPC_REMOTE_DIED = 8,
    /** The operation is not supported */
    SLE_ERR_UNSUPPORTED = 9,
    /** The operation is refused by remote device */
    SLE_ERR_REFUSED_BY_REMOTE = 10,
    /** The operation goes wrong in sle hal */
    SLE_ERR_DRIVER_OR_MODUAL_GOES_WRONG = 11,
    /** The operation goes wrong for the num out of range*/
    SLE_ERR_OUT_RANGE = 12,
    /** The operation goes wrong for the time out */
    SLE_ERR_TIME_OUT = 13,
    /** Checkout failed */
    SLE_ERR_CHECKOUT_FAILED = 14,
    /** Frame internal wrong */
    SLE_ERR_INTERNAL_WRONG = 15,
    /** Keep SLE_COMMON_ERR_BASE at the end of common errorCode */
    SLE_COMMON_ERR_BASE = 20,


    /** EnableSle success when sle already enabled */
    SLE_ERR_ENABLE_SUCCESS_WHEN_ENABLED = 30,
    /** EnableSle failed when sle is enabling */
    SLE_ERR_ENABLE_FAILED_WHEN_ENABLING = 31,
    /** EnableSle failed when sle is disabling*/
    SLE_ERR_ENABLE_FAILED_WHEN_DISABLING = 32,
    /** DisableSle success when sle already disabled */
    SLE_ERR_DISABLE_SUCCESS_WHEN_DISABLED = 33,
    /** DisableSle failed when sle is disabling */
    SLE_ERR_DISABLE_FAILED_WHEN_DISABLING = 34,
    /** DisableSle failed when sle is enabling*/
    SLE_ERR_DISABLE_FAILED_WHEN_ENABLING = 35,

    SLE_ERR_EBABLE_SEEK_SUCCESS_WHEN_SEEK = 36,
    SLE_ERR_DISABLE_SEEK_SUCCESS_WHEN_NOT_SEEK = 37,
    SLE_ERR_EBABLE_ANNOUNCE_SUCCESS_WHEN_ANNOUNCE = 38,
    SLE_ERR_DISABLE_ANNOUNCE_SUCCESS_WHEN_NOT_ANNOUNCE = 39,

    SLE_ERR_CONNECT_SUCCESS_WHEN_CONNECTED = 40,
    SLE_ERR_DISCONNECT_SUCCESS_WHEN_DISCONNECTED = 41,

    /** Sle driver/sdk error **/
    SLE_ERR_SSAP_ERROR = 50,
    SLE_ERR_SLE_ERROR = 51,
    /** keep SLE_ERR_UNKNOWN at the end of errorCode */
    SLE_ERR_UNKNOWN = 63
} SleErrorCode_t;
typedef uint8_t SleErrorCode;
#endif //SLE_ERROR_CODE_H